﻿;$(document).ready(function () {
    $('body').append(
      '<div id="overallDiv" style="position: fixed; left: 0px; bottom: 0px; width: 100%;">' +
        '<div id="hoverBar" style="height: 3px; width: 170px; margin-left: auto; margin-right: auto; background-color: #919191;"></div>' +
        '<div id="madeTag" style="display: none; cursor: pointer; height: 25px; width: 170px; font-family: helvetica,arial; font-size: 16px; padding-top: 10px; margin-left: auto; margin-right: auto; background-color: #fafafa; box-shadow: 0 0px 8px 6px rgba(215,215,215,1);">' +
          '<span style="display: inline-block; float: left; margin-left: 10px;">Made with</span><img style="margin-top: 1px; margin-left: 5px; float: left;" src="/images/madewithaxure.png" />' +
        '</div>' +
      '</div>');

    var hideAd = true;
    var initialLoad = true;

    $('#madeTag').hover(function () { hideAd = false; }, function () { hideAd = true; setTimeout(hideFunc, 500); });

    $('#madeTag').click(function (){
        window.top.location.href = 'http://www.axure.com/livesitead';
    });

    $('#hoverBar').mouseenter(function () {
        showFunc();
    });

    var showFunc = function () {
        $('#hoverBar').hide();
        $('#madeTag').slideDown(300);

        if(initialLoad){
            setTimeout(hideFunc, 3000);
            initialLoad = false;
        }
    };

    var hideFunc = function () {
        if (hideAd == false) return;

        $('#madeTag').slideUp(300);
        $('#hoverBar').show();
    };

    setTimeout(showFunc, 1000);
});
